﻿using System;

namespace monitor_2_DBwork
{
    class ServerLog : IRepositoryName, IComparable
    {
        public ServerLog() { }

        public ServerLog(string login, int? access, int? idobl, int category, string eventName, DateTime date)
        {
            Login = login;
            Idaccess = access;
            Idobl = idobl;
            Name = eventName;
            Date = date;
            Idcategory = category;
        }

        public virtual int Id { get; protected set; }

        public virtual string Login { get; set; }

        //ublic virtual string Access { get; set; }

        public virtual int? Idaccess { get; set; }

        public virtual int? Idobl { get; set; }

        public virtual int Idcategory { get; set; }

        public virtual string Name { get; set; }

        public virtual Category CategoryType { get; set; }

        public virtual Access AccessType { get; set; }

        public virtual DateTime Date { get; set; }

        public virtual Oblast Oblast { get; set; }

        public virtual int CompareTo(object obj)
        {
            return - DateTime.Compare(Date, ((ServerLog) obj).Date);
        }
    }
}
